package mainpkge;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.*;

/**
 * @author Bacalá
 */
public class MidletCanvas extends MIDlet implements CommandListener {

    Display d;
    ShootDownAirCraft b;
    Command sair;

    public void startApp() {
        d = Display.getDisplay(this);
        sair = new Command("SAIR", Command.EXIT, 0);
        b = new ShootDownAirCraft();
        b.addCommand(sair);
        b.setCommandListener(this);
        d.setCurrent(b);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
        

    }

    public void commandAction(Command c, Displayable d) {
        if (c == sair) {
            destroyApp(true);
            notifyDestroyed();
        }
    }
}
